package io;

import java.awt.Graphics2D;
import java.io.FileOutputStream;

import javax.swing.JTable;
/*
import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfTemplate;
import com.itextpdf.text.pdf.PdfWriter;
*/
public class CreatePDF extends Thread{
/*
	public void run(){
		createPdf(false);
	}
	
	JTable table = new JTable();
	public void createPdf(boolean shapes) {
		Document document = new Document();
		try {
			PdfWriter writer;
			if (shapes)
				writer = PdfWriter.getInstance(document,
						new FileOutputStream("my_jtable_shapes.pdf"));
			else
				writer = PdfWriter.getInstance(document,
						new FileOutputStream("my_jtable_fonts.pdf"));
			document.open();
			PdfContentByte cb = writer.getDirectContent();
			PdfTemplate tp = cb.createTemplate(500, 500);
			Graphics2D g2;
			if (shapes)
				g2 = tp.createGraphicsShapes(500, 500);
			else
				g2 = tp.createGraphics(500, 500);
			table.print(g2);
			g2.dispose();
			cb.addTemplate(tp, 30, 300);
		} catch (Exception e) {
			System.err.println(e.getMessage());
		}
		document.close();
	}*/
}
